﻿@inject IStringLocalizer<CheckboxBindString> Localizer

<div class="row g-3 form-inline">
    <div class="col-12">
        <Checkbox TValue="string" DisplayText="@Localizer["Checkbox2Text"]" ShowLabel="true" @bind-Value="@BindString" OnStateChanged="@OnItemChangedString" />
    </div>
    <div class="col-12">
        <BootstrapInput @bind-Value="@BindString" />
    </div>
</div>
<ConsoleLogger @ref="Logger" class="mt-3" />

@code {
    [NotNull]
    private ConsoleLogger? Logger { get; set; }

    private string BindString { get; set; } = "我爱 Blazor";

    private Task OnItemChangedString(CheckboxState state, string value)
    {
        Logger.Log($"CheckboxState: {state} - Bind Value: {value}");
        return Task.CompletedTask;
    }
}
